package ch.sv7.tool.dbmanager.types;

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;

/**
 * TODO: Document me!
 *
 * @author svt
 *
 */
public class SybaseTypesInfo extends ConnectionTypesInfo {

	/**
	 * @param conn
	 * @throws SQLException
	 */
	public SybaseTypesInfo(Connection conn) throws SQLException {
		super(conn);
		addTypesInfo();
	}

	protected void addTypesInfo() {
		TypeInfo type = new TypeInfo();
		type.setTypeName("timestamp");
		type.setJdbcType(-3);
		type.setPrecision(8);
		type.setLiteralPrefix("'");
		type.setLiteralSuffix("'");
		type.setCreateParams(null);
		type.setNullable(DatabaseMetaData.attributeNullable);
		type.setCaseSensitive(false);
		type.setSearchable((short)DatabaseMetaData.typeSearchable);
		type.setUnsigned(false);
		type.setMoneyValue(false);
		type.setAutoIncrement(false);
		type.setLocalTypeName("timestamp");
		type.setMinScale((short)0);
		type.setMaxScale((short)0);
		type.setNumPrecisionRadix(0);
		typesMap.put(type.getTypeName(), type);
		
		type = (TypeInfo)typesMap.get("varchar");
		type = (TypeInfo)type.clone();
		type.setTypeName("univarchar");
		typesMap.put(type.getTypeName(), type);

		type = (TypeInfo)typesMap.get("char");
		type = (TypeInfo)type.clone();
		type.setTypeName("unichar");
		typesMap.put(type.getTypeName(), type);
		
		type = (TypeInfo)typesMap.get("float");
		type = (TypeInfo)type.clone();
		typesMap.put("double precis", type);
		

	}
}
